package com.xpgk.xpsoft.index;

import java.util.List;

import com.jfinal.kit.JsonKit;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Record;
import com.xpgk.common.controller.BaseController;
import com.xpgk.xpsoft.system.SystemService;

public class IndexController extends BaseController {

	public void index() {
		List<Kv> m = IndexService.GetUserMenu(getCurUserID());
		String menu = JsonKit.toJson(m);

		setAttr("deptName", IndexService.GetUserDeptName(getCurUserID()));
		setAttr("userName", getCurUserName());
		setAttr("menu", menu);
		Record record = SystemService.GetSystem();
		if (record != null) {
			setAttr("title", record.getStr("title"));
			setAttr("foot", record.getStr("foot"));
		}
		render("index.html");
	}

	public void home() {

		render("home.html");
	}
}
